﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageStrategy.aspx.cs" Inherits="ManageStrategy" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>策略管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
        策略管理：<br />
        <br />
        <asp:GridView ID="categorieGridView1" runat="server" AutoGenerateColumns="False" OnRowCancelingEdit="categorieGridView1_RowCancelingEdit"
            OnRowDeleting="categorieGridView1_RowDeleting" OnRowEditing="categorieGridView1_RowEditing" OnRowUpdating="categorieGridView1_RowUpdating"
            Width="260px" DataKeyNames="Categorie" DataSourceID="categoriesSqlDataSource1">
            <Columns>
                <asp:BoundField DataField="Categorie" HeaderText="Categorie" ReadOnly="True" SortExpression="Categorie" />
                <asp:BoundField DataField="Department" HeaderText="Department" SortExpression="Department" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
        <br />
        &nbsp; 添加策略信息:<br />
        策略:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
        部门<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
        <br />
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="添加" /><br />
        &nbsp;<br />
        <br />
        <br />
        <asp:SqlDataSource ID="categoriesSqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:webinfConnectionStringLocalhost %>"
            DeleteCommand="DELETE FROM Categorie WHERE (Categorie = @categorie)" InsertCommand="INSERT INTO Categorie(Categorie, Department) VALUES (@Categorie, @Department)"
            SelectCommand="SELECT * FROM [Categorie]" UpdateCommand="UPDATE Categorie SET Categorie = @categorie, Department = @department">
            <DeleteParameters>
                <asp:Parameter Name="categorie" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:ControlParameter ControlID="TextBox1" DefaultValue="0" Name="categorie" PropertyName="Text" />
                <asp:ControlParameter ControlID="TextBox2" DefaultValue="0" Name="department" PropertyName="Text" />
            </UpdateParameters>
            <InsertParameters>
                <asp:ControlParameter ControlID="TextBox1" DefaultValue="0" Name="Categorie" PropertyName="Text" />
                <asp:ControlParameter ControlID="TextBox2" DefaultValue="0" Name="Department" PropertyName="Text" />
            </InsertParameters>
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>
